.class public Lcom/xingbook/ui/d;
.super Landroid/view/ViewGroup;

# interfaces
.implements Landroid/view/View$OnClickListener;
.implements Lcom/xingbook/ui/y;


# static fields
.field private static a:Lcom/xingbook/ui/d;


# instance fields
.field private b:Lcom/xingbook/ui/WindmillView;

.field private c:Lcom/xingbook/ui/e;

.field private d:Landroid/widget/ImageView;

.field private e:Landroid/widget/ImageView;

.field private f:Lcom/xingbook/ui/ad;

.field private g:Landroid/content/res/Resources;


# direct methods
.method static constructor <clinit>()V
    .locals 1

    const/4 v0, 0x0

    sput-object v0, Lcom/xingbook/ui/d;->a:Lcom/xingbook/ui/d;

    return-void
.end method

.method private constructor <init>(Landroid/app/Activity;Lcom/xingbook/ui/e;)V
    .locals 1

    invoke-virtual {p1}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-direct {p0, v0}, Landroid/view/ViewGroup;-><init>(Landroid/content/Context;)V

    iput-object p2, p0, Lcom/xingbook/ui/d;->c:Lcom/xingbook/ui/e;

    invoke-direct {p0, p1}, Lcom/xingbook/ui/d;->setupLayout(Landroid/app/Activity;)V

    return-void
.end method

.method public static a(Landroid/app/Activity;Lcom/xingbook/ui/e;)Lcom/xingbook/ui/d;
    .locals 1

    sget-object v0, Lcom/xingbook/ui/d;->a:Lcom/xingbook/ui/d;

    if-nez v0, :cond_0

    new-instance v0, Lcom/xingbook/ui/d;

    invoke-direct {v0, p0, p1}, Lcom/xingbook/ui/d;-><init>(Landroid/app/Activity;Lcom/xingbook/ui/e;)V

    sput-object v0, Lcom/xingbook/ui/d;->a:Lcom/xingbook/ui/d;

    :goto_0
    sget-object v0, Lcom/xingbook/ui/d;->a:Lcom/xingbook/ui/d;

    return-object v0

    :cond_0
    sget-object v0, Lcom/xingbook/ui/d;->a:Lcom/xingbook/ui/d;

    iput-object p1, v0, Lcom/xingbook/ui/d;->c:Lcom/xingbook/ui/e;

    goto :goto_0
.end method

.method private setupLayout(Landroid/app/Activity;)V
    .locals 13

    const/4 v12, 0x1

    const/4 v8, 0x0

    const/high16 v10, 0x4248

    const/high16 v9, 0x41a0

    const/high16 v11, 0x4000

    invoke-virtual {p1}, Landroid/app/Activity;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {p1}, Lcom/xingbook/c/n;->f(Landroid/app/Activity;)F

    move-result v1

    invoke-static {p1}, Lcom/xingbook/c/n;->c(Landroid/app/Activity;)I

    move-result v2

    invoke-static {p1}, Lcom/xingbook/c/n;->d(Landroid/app/Activity;)I

    move-result v3

    invoke-virtual {v0}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;

    move-result-object v4

    iput-object v4, p0, Lcom/xingbook/ui/d;->g:Landroid/content/res/Resources;

    const/16 v4, 0xff

    const/16 v5, 0x99

    const/16 v6, 0xe6

    const/16 v7, 0xff

    invoke-static {v4, v5, v6, v7}, Landroid/graphics/Color;->argb(IIII)I

    move-result v4

    invoke-virtual {p0, v4}, Lcom/xingbook/ui/d;->setBackgroundColor(I)V

    iget-object v4, p0, Lcom/xingbook/ui/d;->g:Landroid/content/res/Resources;

    const v5, 0x7f0201fa

    invoke-static {v4, v5}, Lcom/xingbook/c/n;->a(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v4

    new-instance v5, Landroid/graphics/drawable/BitmapDrawable;

    iget-object v6, p0, Lcom/xingbook/ui/d;->g:Landroid/content/res/Resources;

    invoke-direct {v5, v6, v4}, Landroid/graphics/drawable/BitmapDrawable;-><init>(Landroid/content/res/Resources;Landroid/graphics/Bitmap;)V

    const/16 v4, 0x77

    invoke-virtual {v5, v4}, Landroid/graphics/drawable/BitmapDrawable;->setGravity(I)V

    sget-object v4, Landroid/graphics/Shader$TileMode;->REPEAT:Landroid/graphics/Shader$TileMode;

    invoke-virtual {v5, v4}, Landroid/graphics/drawable/BitmapDrawable;->setTileModeX(Landroid/graphics/Shader$TileMode;)V

    sget-object v4, Landroid/graphics/Shader$TileMode;->CLAMP:Landroid/graphics/Shader$TileMode;

    invoke-virtual {v5, v4}, Landroid/graphics/drawable/BitmapDrawable;->setTileModeY(Landroid/graphics/Shader$TileMode;)V

    const/high16 v4, 0x4408

    mul-float/2addr v4, v1

    invoke-static {v4}, Ljava/lang/Math;->round(F)I

    move-result v4

    sub-int v4, v3, v4

    const/high16 v6, 0x43bb

    mul-float/2addr v6, v1

    invoke-static {v6}, Ljava/lang/Math;->round(F)I

    move-result v6

    add-int/2addr v6, v4

    invoke-virtual {v5, v8, v4, v2, v6}, Landroid/graphics/drawable/BitmapDrawable;->setBounds(IIII)V

    new-instance v6, Landroid/widget/ImageView;

    invoke-direct {v6, v0}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    invoke-virtual {v6, v5}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    sget-object v5, Landroid/widget/ImageView$ScaleType;->FIT_XY:Landroid/widget/ImageView$ScaleType;

    invoke-virtual {v6, v5}, Landroid/widget/ImageView;->setScaleType(Landroid/widget/ImageView$ScaleType;)V

    invoke-virtual {v6, v8, v4, v2, v3}, Landroid/widget/ImageView;->layout(IIII)V

    invoke-virtual {p0, v6}, Lcom/xingbook/ui/d;->addView(Landroid/view/View;)V

    new-instance v4, Landroid/widget/ImageView;

    invoke-direct {v4, v0}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    iput-object v4, p0, Lcom/xingbook/ui/d;->d:Landroid/widget/ImageView;

    iget-object v4, p0, Lcom/xingbook/ui/d;->d:Landroid/widget/ImageView;

    invoke-virtual {v4, v12}, Landroid/widget/ImageView;->setId(I)V

    iget-object v4, p0, Lcom/xingbook/ui/d;->d:Landroid/widget/ImageView;

    invoke-virtual {v4, p0}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    mul-float v4, v9, v1

    invoke-static {v4}, Ljava/lang/Math;->round(F)I

    move-result v4

    const/high16 v5, 0x4316

    mul-float/2addr v5, v1

    invoke-static {v5}, Ljava/lang/Math;->round(F)I

    move-result v5

    iget-object v6, p0, Lcom/xingbook/ui/d;->d:Landroid/widget/ImageView;

    add-int v7, v4, v5

    add-int/2addr v5, v4

    invoke-virtual {v6, v4, v4, v7, v5}, Landroid/widget/ImageView;->layout(IIII)V

    iget-object v6, p0, Lcom/xingbook/ui/d;->d:Landroid/widget/ImageView;

    invoke-virtual {p0, v6}, Lcom/xingbook/ui/d;->addView(Landroid/view/View;)V

    new-instance v6, Lcom/xingbook/ui/ad;

    invoke-direct {v6, v0}, Lcom/xingbook/ui/ad;-><init>(Landroid/content/Context;)V

    iput-object v6, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    iget-object v6, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    invoke-virtual {v6, v12}, Lcom/xingbook/ui/ad;->setId(I)V

    iget-object v6, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    invoke-virtual {v6, p0}, Lcom/xingbook/ui/ad;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    iget-object v6, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    const-string v8, "\u661f\u5b9d"

    iput-object v8, v6, Lcom/xingbook/ui/ad;->a:Ljava/lang/String;

    iget-object v6, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    const/high16 v8, 0x4220

    mul-float/2addr v8, v1

    iput v8, v6, Lcom/xingbook/ui/ad;->c:F

    iget-object v6, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    const/4 v8, -0x1

    iput v8, v6, Lcom/xingbook/ui/ad;->b:I

    iget-object v6, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    const/16 v8, 0x13

    iput v8, v6, Lcom/xingbook/ui/ad;->d:I

    iget-object v6, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    add-int/2addr v4, v7

    int-to-float v5, v5

    mul-float v7, v10, v1

    sub-float/2addr v5, v7

    div-float/2addr v5, v11

    invoke-static {v5}, Ljava/lang/Math;->round(F)I

    move-result v5

    const/high16 v7, 0x4396

    mul-float/2addr v7, v1

    invoke-static {v7}, Ljava/lang/Math;->round(F)I

    move-result v7

    add-int/2addr v7, v4

    mul-float v8, v10, v1

    invoke-static {v8}, Ljava/lang/Math;->round(F)I

    move-result v8

    add-int/2addr v8, v5

    invoke-virtual {v6, v4, v5, v7, v8}, Lcom/xingbook/ui/ad;->layout(IIII)V

    iget-object v4, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    invoke-virtual {p0, v4}, Lcom/xingbook/ui/d;->addView(Landroid/view/View;)V

    iget-object v4, p0, Lcom/xingbook/ui/d;->g:Landroid/content/res/Resources;

    const v5, 0x7f02023c

    invoke-static {v4, v5}, Lcom/xingbook/c/n;->a(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v4

    new-instance v5, Landroid/widget/ImageView;

    invoke-direct {v5, v0}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    iput-object v5, p0, Lcom/xingbook/ui/d;->e:Landroid/widget/ImageView;

    iget-object v5, p0, Lcom/xingbook/ui/d;->e:Landroid/widget/ImageView;

    const/4 v6, 0x2

    invoke-virtual {v5, v6}, Landroid/widget/ImageView;->setId(I)V

    iget-object v5, p0, Lcom/xingbook/ui/d;->e:Landroid/widget/ImageView;

    invoke-virtual {v5, p0}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    mul-float v5, v9, v1

    invoke-static {v5}, Ljava/lang/Math;->round(F)I

    move-result v5

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v6

    iget-object v7, p0, Lcom/xingbook/ui/d;->e:Landroid/widget/ImageView;

    sub-int v8, v2, v6

    sub-int/2addr v8, v5

    sub-int v9, v2, v5

    add-int v10, v5, v6

    invoke-virtual {v7, v8, v5, v9, v10}, Landroid/widget/ImageView;->layout(IIII)V

    iget-object v5, p0, Lcom/xingbook/ui/d;->e:Landroid/widget/ImageView;

    invoke-virtual {p0, v5}, Lcom/xingbook/ui/d;->addView(Landroid/view/View;)V

    new-instance v5, Landroid/widget/ImageView;

    invoke-direct {v5, v0}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    invoke-virtual {v5, v4}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    const/4 v7, 0x2

    invoke-virtual {v5, v7}, Landroid/widget/ImageView;->setId(I)V

    invoke-virtual {v5, p0}, Landroid/widget/ImageView;->setOnClickListener(Landroid/view/View$OnClickListener;)V

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v7

    div-int/lit8 v7, v7, 0x2

    sub-int v7, v10, v7

    add-int/2addr v6, v8

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v4

    add-int/2addr v4, v7

    invoke-virtual {v5, v8, v7, v6, v4}, Landroid/widget/ImageView;->layout(IIII)V

    invoke-virtual {p0, v5}, Lcom/xingbook/ui/d;->addView(Landroid/view/View;)V

    invoke-virtual {p0}, Lcom/xingbook/ui/d;->a()V

    iget-object v4, p0, Lcom/xingbook/ui/d;->g:Landroid/content/res/Resources;

    const v5, 0x7f020224

    invoke-static {v4, v5}, Lcom/xingbook/c/n;->a(Landroid/content/res/Resources;I)Landroid/graphics/Bitmap;

    move-result-object v4

    new-instance v5, Landroid/widget/ImageView;

    invoke-direct {v5, v0}, Landroid/widget/ImageView;-><init>(Landroid/content/Context;)V

    invoke-virtual {v5, v4}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->getWidth()I

    move-result v0

    sub-int v0, v2, v0

    int-to-float v0, v0

    div-float/2addr v0, v11

    invoke-static {v0}, Ljava/lang/Math;->round(F)I

    move-result v0

    invoke-virtual {v4}, Landroid/graphics/Bitmap;->getHeight()I

    move-result v4

    sub-int v4, v3, v4

    sub-int v6, v2, v0

    invoke-virtual {v5, v0, v4, v6, v3}, Landroid/widget/ImageView;->layout(IIII)V

    invoke-virtual {p0, v5}, Lcom/xingbook/ui/d;->addView(Landroid/view/View;)V

    const v0, 0x443e8000

    mul-float/2addr v0, v1

    new-instance v3, Lcom/xingbook/ui/WindmillView;

    invoke-virtual {p0}, Lcom/xingbook/ui/d;->getContext()Landroid/content/Context;

    move-result-object v5

    invoke-direct {v3, v5}, Lcom/xingbook/ui/WindmillView;-><init>(Landroid/content/Context;)V

    iput-object v3, p0, Lcom/xingbook/ui/d;->b:Lcom/xingbook/ui/WindmillView;

    iget-object v3, p0, Lcom/xingbook/ui/d;->b:Lcom/xingbook/ui/WindmillView;

    invoke-virtual {v3, v0, p0}, Lcom/xingbook/ui/WindmillView;->a(FLcom/xingbook/ui/y;)V

    div-float/2addr v0, v11

    int-to-float v2, v2

    div-float/2addr v2, v11

    int-to-float v3, v4

    const/high16 v4, 0x42a0

    mul-float/2addr v1, v4

    sub-float v1, v3, v1

    iget-object v3, p0, Lcom/xingbook/ui/d;->b:Lcom/xingbook/ui/WindmillView;

    sub-float v4, v2, v0

    invoke-static {v4}, Ljava/lang/Math;->round(F)I

    move-result v4

    sub-float v5, v1, v0

    invoke-static {v5}, Ljava/lang/Math;->round(F)I

    move-result v5

    add-float/2addr v2, v0

    invoke-static {v2}, Ljava/lang/Math;->round(F)I

    move-result v2

    add-float/2addr v0, v1

    invoke-static {v0}, Ljava/lang/Math;->round(F)I

    move-result v0

    invoke-virtual {v3, v4, v5, v2, v0}, Lcom/xingbook/ui/WindmillView;->layout(IIII)V

    iget-object v0, p0, Lcom/xingbook/ui/d;->b:Lcom/xingbook/ui/WindmillView;

    invoke-virtual {p0, v0}, Lcom/xingbook/ui/d;->addView(Landroid/view/View;)V

    return-void
.end method


# virtual methods
.method public a()V
    .locals 3

    sget-object v0, Lcom/xingbook/c/n;->e:Lcom/xingbook/b/a;

    iget-object v1, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    invoke-virtual {v0}, Lcom/xingbook/b/a;->a()Ljava/lang/String;

    move-result-object v2

    iput-object v2, v1, Lcom/xingbook/ui/ad;->a:Ljava/lang/String;

    iget-object v1, p0, Lcom/xingbook/ui/d;->f:Lcom/xingbook/ui/ad;

    invoke-virtual {v1}, Lcom/xingbook/ui/ad;->invalidate()V

    invoke-virtual {p0}, Lcom/xingbook/ui/d;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/xingbook/b/a;->b(Landroid/content/res/Resources;)Landroid/graphics/Bitmap;

    move-result-object v1

    iget-object v2, p0, Lcom/xingbook/ui/d;->d:Landroid/widget/ImageView;

    invoke-virtual {v2, v1}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    iget-object v1, p0, Lcom/xingbook/ui/d;->d:Landroid/widget/ImageView;

    invoke-virtual {v1}, Landroid/widget/ImageView;->invalidate()V

    invoke-virtual {p0}, Lcom/xingbook/ui/d;->getResources()Landroid/content/res/Resources;

    move-result-object v1

    invoke-virtual {v0, v1}, Lcom/xingbook/b/a;->a(Landroid/content/res/Resources;)Landroid/graphics/Bitmap;

    move-result-object v0

    iget-object v1, p0, Lcom/xingbook/ui/d;->e:Landroid/widget/ImageView;

    invoke-virtual {v1, v0}, Landroid/widget/ImageView;->setImageBitmap(Landroid/graphics/Bitmap;)V

    iget-object v0, p0, Lcom/xingbook/ui/d;->e:Landroid/widget/ImageView;

    invoke-virtual {v0}, Landroid/widget/ImageView;->invalidate()V

    return-void
.end method

.method public a(I)V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ui/d;->c:Lcom/xingbook/ui/e;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/d;->c:Lcom/xingbook/ui/e;

    add-int/lit8 v1, p1, 0xa

    invoke-interface {v0, v1}, Lcom/xingbook/ui/e;->a(I)V

    :cond_0
    return-void
.end method

.method public onClick(Landroid/view/View;)V
    .locals 2

    iget-object v0, p0, Lcom/xingbook/ui/d;->c:Lcom/xingbook/ui/e;

    if-eqz v0, :cond_0

    iget-object v0, p0, Lcom/xingbook/ui/d;->c:Lcom/xingbook/ui/e;

    invoke-virtual {p1}, Landroid/view/View;->getId()I

    move-result v1

    invoke-interface {v0, v1}, Lcom/xingbook/ui/e;->a(I)V

    :cond_0
    return-void
.end method

.method protected onDetachedFromWindow()V
    .locals 0

    invoke-super {p0}, Landroid/view/ViewGroup;->onDetachedFromWindow()V

    return-void
.end method

.method protected onLayout(ZIIII)V
    .locals 0

    return-void
.end method

.method public setAnimating(Z)V
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ui/d;->b:Lcom/xingbook/ui/WindmillView;

    invoke-virtual {v0, p1}, Lcom/xingbook/ui/WindmillView;->setRunning(Z)V

    return-void
.end method

.method public setWindmillViewPause(Z)V
    .locals 1

    iget-object v0, p0, Lcom/xingbook/ui/d;->b:Lcom/xingbook/ui/WindmillView;

    invoke-virtual {v0, p1}, Lcom/xingbook/ui/WindmillView;->setPaused(Z)V

    return-void
.end method
